﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;

namespace RealtorsPortal.AdminCP
{
    public partial class Default : System.Web.UI.Page
    {
        protected void Page_Load(object sender, EventArgs e)
        {
            this.SetDisplay();
        }

        private void SetDisplay()
        {
            string role = (Session["adminRole"]!=null)?Session["adminRole"].ToString():"";
            if (role == "Administrator")
            {
                pnlAdmin.Visible = true;
                pnlUser.Visible = false;
            }
            else if(role=="")
            {
                Response.Redirect("Login.aspx");
            }
            else
            {
                pnlAdmin.Visible = false;
                pnlUser.Visible = true;
            }
        }
    }
}